<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <meta charset="UTF-8">
        <title>Edit</title>
    </head>
    <body>
        <?php
        if (count($websurvey['Question']) != 0) {
            echo '<h1>';
            echo $websurvey['Question'][$questionPos]['question_text'];
            echo '</h1>'; 
            echo '<br>';
            echo '<textarea  rows="3" cols="20"></textarea>';
        }
        ?>
       
        <?php
        echo $this->Html->link(
                'Add', array('controller' => 'Questions', 'action' => 'add', $websurvey['WebSurvey']['id']));
        ?>
        <br>
        <?php 
        if (count($websurvey['Question']) != 0) {
            echo $this->Form->postLink(
                    'Delete',
                        array('controller'=> 'Questions', 'action' => 'delete', $websurvey['Question'][$questionPos]['id'], $questionPos),
                        array('confirm' => 'Are you sure that you want to delete this question?'));
        }
        ?>
        <?php
        if (count($websurvey['Question']) != 0) {
            $position = ($questionPos == '0') ? $questionPos :  strval(intval(--$questionPos));
            echo $this->Html->link(
                    'Previous', array('controller' => 'WebSurveys', 'action' => 'edit', $websurvey['WebSurvey']['id'], $position));
        }
        ?>
        <?php
        if (count($websurvey['Question'])-1 > $questionPos){
            $position = strval(intval(++$questionPos));
            echo $this->Html->link(
                    'Next', array('controller' => 'WebSurveys', 'action' => 'edit', $websurvey['WebSurvey']['id'], $position));
        }
        ?>        
    </body>
</html>
